<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="jquery-3.2.1.min.js"></script>
</head>
<body>
<input type="button" id="req1" value="请求1" />
<input type="button" id="req2" value="请求2" />
<br>
<span id="reqRet"></span>
<script>
    $(function () {
        $("#req1").on("click",function () {
            $.ajax({
                url: "/getHello",
                type: "GET",
                beforeSend: function(xhr){
                    xhr.setRequestHeader('token', 'hillchen:hillchen123');
                    xhr.setRequestHeader('system', 'test2');
                },
                success: function(ret) {
                    debugger
                    $("#reqRet").text(ret);
                }
            });
        });

        $("#req2").on("click",function () {
            $.ajax({
                url: "/getHello",
                type: "GET",
                beforeSend: function(xhr){
                    xhr.setRequestHeader('system', 'test2');
                },
                success: function(ret) {
                    debugger
                    $("#reqRet").text(ret);
                }
            });
        });
    });
</script>
</body>
</html>